//
//  tooles.h
//  huoche
//
//  Created by kan xu on 11-1-22.
//  Copyright 2011 paduu. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface tooles : NSObject

+(void)dismissGlobalAlert;
+(void)showGlobalAlertWithTitle:(NSString*)title andMsg:(NSString*)msg delegate:(id<UIAlertViewDelegate>)delegate cancelButtonTitle:(NSString *)cancelButtonTitle otherButtonTitles:(NSString *)otherButtonTitles;

+(void)orderButtons:(NSArray*)butArray byCode:(NSInteger)code;

+(UIImage*)getImageByColor:(UIColor*)aColor;
//版本检测管理
+(NSString*)versionArray;

+(float)DeviceVersion;

+(NSDate *)dateFromString:(NSString *)dateString;
+(NSString *)stringFromDate:(NSDate *)date;

+(NSString *)nibname:(NSString *)nibNameOrNil;

+ (NSString *)defaultViewControllerWithNibName:(NSString *)nibNameOrNil;

//正则
//是否是信用卡号
+ (BOOL)validateCreditCard:(NSString*)iStr;
//是否是信用卡有效期
+ (BOOL)validatePeriodCard:(NSString*)aStr;
//是否是信用卡验证码
+ (BOOL)validateCreditCode:(NSString*)aStr;
//是否是纯数字
+(BOOL)validateNumber:(NSString*)aStr;
//是否是座机+分机
+(BOOL)validatePhone:(NSString*)aStr;
//是否是手机
+(BOOL)validateTelephone:(NSString*)aStr;
//是否是用户名
+(BOOL)validateUsername:(NSString*)aStr;
//是否是密码
+(BOOL)validatePassword:(NSString*)aStr;
//是否是邮箱
+(BOOL)validateEmail:(NSString*)aStr;
//是否是中文姓名
+(BOOL)validateChineseName:(NSString*)aStr;
//旋转照片
+(UIImage *)rotateImage:(UIImage *)aImage;

+(UIImage *)scaleImage:(UIImage *)image;

+(NSString*)replaceNullFromDic:(NSDictionary*)aDic withKeyArray:(NSArray*)aArray;

@end